[SER] Transform RayDesc in ScalarReplHLSL for robust lowering#7435
[SER] Transform RayDesc in ScalarReplHLSL for robust lowering#7435simoll wants to merge 2 commits intomicrosoft:mainfrom
Conversation
ScalarReplHLSL will refuse to faltten RayDesc if some users are incompatible. This is at odds with HLOperationLower, which always expects a specific flattened form. This implements explicit RayDesc flattening in ScalarReplHLSL to make this more reliable. One issue with RayDesc-from-cbuffer in RayQuery remains and is documented with a test. Implement ScalarReplHLSL handling for RayDesc param in HL ops: - HitObject::MakeMiss [RewriteCallArg] - HitObject::TraceRay [RewriteCallArg] - TraceRay [RewriteCallArg] - RayQuery::TraceRayInline [unchanged - flatten to RayDesc elements] In the process: - Fix copyout code in RewriteCallArg (ScalarReplHLSL) - Remove obsolete tests that expected a RayDesc alloca (where RayDesc is now SROA'd entirely) - Document RayQuery lowering bug when RayDesc is taken directly from cbuffer. Closes microsoft#7434 Unflattened RayDesc breaking HL->DXIL lowering microsoft#7434
|
Pipelines failing because the |
pow2clk
left a comment
There was a problem hiding this comment.
I just have one question.
I think we've decided to move forward with this change for the time being. I think @tex3d had a conversation with Jeff Noyle and confirmed that the pix test changes are fine. Since the alternatives would, at least, require significantly more testing, it's preferrable to take this solution while those get completed.
| MemCpyInst *cpy = cast<MemCpyInst>(Builder.CreateMemCpy( | ||
| userTyV, Alloca, DL.getTypeAllocSize(userTyElt), false)); | ||
| RewriteMemIntrin(cpy, cpy->getRawSource()); | ||
| RewriteMemIntrin(cpy, cpy->getRawDest()); |
There was a problem hiding this comment.
This change has fewer than expected, but nevertheless extant, though potentially subtle effects. What prompted it?
There was a problem hiding this comment.
This was erroneously triggering the memcpy-undef-to-undef-optimization inRewriteMemIntrin for the out-copy. This change makes the in and out RewriteMemIntrin calls symmetric and resolves the mis-optimization.
…yDesc is no longer flattened
|
We're closing this one in favor of #7440. |
ScalarReplHLSL will refuse to faltten RayDesc if some users are incompatible. This is at odds with HLOperationLower, which always expects a specific flattened form.
This implements explicit RayDesc flattening in ScalarReplHLSL to make this more reliable. One issue with RayDesc-from-cbuffer in RayQuery remains and is documented with a test.
Implement ScalarReplHLSL handling for RayDesc param in HL ops:
In the process:
Closes #7434 Unflattened RayDesc breaking HL->DXIL lowering #7434